<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
/*
Route::get('/', function () {
    return view('welcome');
});*/

//城市级联操作
Route::get('/district',function(){ return view('district.index'); });
Route::get('/district/{upid}',"home\DistrictController@find"); //加载城市级联信息

//购物车
Route::get('home/shop',"home\ShopController@index"); 		//浏览购物车
Route::get('home/shop/add/{id}',"home\ShopController@add"); //放入购物车
Route::get('home/shop/del/{id}',"home\ShopController@del"); //删除购物车中的某个商品
Route::get('home/shop/clear',"home\ShopController@clear"); //清空购物车

/**
	前台路由器
	prefix	为get方法获取的前缀名称
	middleware => admin 中间建名为admin
	uses 指向对应操作的控制器及内部方法
*/
Route::group(['prefix'=>'home'],function(){
	Route::get('index',"home\IndexController@index");					//前台首页
	Route::resource('port','home\PortController');						//前台对应类别页
	Route::resource('list','home\ListController');						//前台对应列表页
	Route::resource('mall','home\MallController');						//前台商品详情信息页
});

Route::resource('home/center','home\CenterController');					//前台个人中心页

//网站前台路由配置
Route::get('/home/login',"home\LoginController@login");					//加载前台登录界面
Route::post('/home/doLogin',"home\LoginController@doLogin");			//执行前台退出
Route::get('/home/logout',"home\LoginController@logout");				//执行退出


//网站后台路由配置
Route::get('/admin/login',"admin\LoginController@login");				//加载后台登录界面
Route::post('/admin/doLogin',"admin\LoginController@doLogin");			//执行后台退出
Route::get('/admin/logout',"admin\LoginController@logout");				//执行退出
Route::get('/admin/getcode',"admin\LoginController@getCode");			//加载验证码

/**
	后台路由器
	prefix	为get方法获取的前缀名称
	middleware => admin 中间建名为admin
	uses 指向对应操作的控制器及内部方法
*/
Route::group(['prefix'=>'admin','middleware'=>'admin'],function(){
	Route::get('/',"admin\IndexController@index");						//后台首页
	Route::resource('user','admin\UserController');						//后台用户账号管理
	Route::resource('type', 'admin\TypeController'); 					//后台商品类别管理
	Route::resource('forum','admin\ForumController');					//后台商品板块信息
	Route::resource('genre','admin\GenreController');					//后台商品类别信息
	Route::resource('minfo','admin\MinfoController');					//后台商品信息管理
	Route::resource('slide','admin\SlideController');					//后台首页轮播图管理
	Route::get('/find',"admin\MinfoController@find");					//后台商品标签ajax无刷新生成
	Route::resource('pic','admin\PictureController');					//后台商品图片管理	
	Route::resource('pag','admin\PagController');						//后台商品图片管理
	Route::resource('friendlink','admin\FriendlinkController');			//后台友情链接管理
	Route::resource('indentinfo','admin\IndentinfoController');			//后台订单管理
	Route::resource('users','admin\UserController');					//后台用户信息管理
	Route::resource('notice','admin\NoticeController');					//后台公告管理
	Route::resource('score','admin\ScoreController');					//后台评分管理
});
